package net.supcmdr.dnd5e.ui.subpanels.character;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.border.LineBorder;

@SuppressWarnings("serial")
public class CombatStatsPanel extends JPanel {
	
	private JTextField acValue;
	private JTextField initiativeValue;
	private JTextField speedValue;
	private JTextField maxHPValue;
	private JTextField totalHitDiceValue;
	
	
	public CombatStatsPanel() {
		
		System.out.println("    -Creating CombatStatsPanel");
		
		setMinimumSize(new Dimension(325,440));
		setPreferredSize(new Dimension(325, 440));
		setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
		setLayout(null);
		
		JLabel lblHealthArmor = new JLabel("Health & Armor");
		lblHealthArmor.setHorizontalAlignment(SwingConstants.CENTER);
		lblHealthArmor.setFont(new Font("Tahoma", Font.BOLD, 18));
		lblHealthArmor.setBounds(10, 11, 305, 22);
		add(lblHealthArmor);
		
		JLabel lblArmorClass = new JLabel("Armor Class");
		lblArmorClass.setHorizontalAlignment(SwingConstants.CENTER);
		lblArmorClass.setBounds(20, 44, 80, 14);
		add(lblArmorClass);
		
		acValue = new JTextField();
		acValue.setBounds(20, 58, 80, 20);
		add(acValue);
		acValue.setColumns(10);
		
		JLabel lblInitiative = new JLabel("Initiative");
		lblInitiative.setHorizontalAlignment(SwingConstants.CENTER);
		lblInitiative.setBounds(120, 44, 80, 14);
		add(lblInitiative);
		
		initiativeValue = new JTextField();
		initiativeValue.setColumns(10);
		initiativeValue.setBounds(120, 58, 80, 20);
		add(initiativeValue);
		
		JLabel lblSpeed = new JLabel("Speed");
		lblSpeed.setHorizontalAlignment(SwingConstants.CENTER);
		lblSpeed.setBounds(220, 44, 80, 14);
		add(lblSpeed);
		
		speedValue = new JTextField();
		speedValue.setColumns(10);
		speedValue.setBounds(220, 58, 80, 20);
		add(speedValue);
		
		JPanel panel = new JPanel();
		panel.setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
		panel.setBounds(10, 89, 305, 110);
		add(panel);
		panel.setLayout(null);
		
		JLabel lblMaxHp = new JLabel("Max HP:");
		lblMaxHp.setHorizontalAlignment(SwingConstants.CENTER);
		lblMaxHp.setBounds(10, 11, 50, 14);
		panel.add(lblMaxHp);
		
		maxHPValue = new JTextField();
		maxHPValue.setBounds(70, 8, 225, 20);
		panel.add(maxHPValue);
		maxHPValue.setColumns(10);
		
		JLabel lblCurrentHp = new JLabel("Current HP");
		lblCurrentHp.setHorizontalAlignment(SwingConstants.CENTER);
		lblCurrentHp.setBounds(10, 85, 285, 14);
		panel.add(lblCurrentHp);
		
		JTextArea currentHPValue = new JTextArea();
		currentHPValue.setBorder(UIManager.getBorder("TextField.border"));
		currentHPValue.setBounds(10, 36, 285, 45);
		panel.add(currentHPValue);
		
		JPanel panel_1 = new JPanel();
		panel_1.setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
		panel_1.setBounds(10, 210, 305, 89);
		add(panel_1);
		panel_1.setLayout(null);
		
		JLabel lblTempHp = new JLabel("Temp HP");
		lblTempHp.setHorizontalAlignment(SwingConstants.CENTER);
		lblTempHp.setBounds(10, 67, 285, 14);
		panel_1.add(lblTempHp);
		
		JTextArea tempHPValue = new JTextArea();
		tempHPValue.setBorder(UIManager.getBorder("TextField.border"));
		tempHPValue.setBounds(10, 11, 285, 45);
		panel_1.add(tempHPValue);
		
		JPanel panel_2 = new JPanel();
		panel_2.setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
		panel_2.setBounds(10, 310, 140, 115);
		add(panel_2);
		panel_2.setLayout(null);
		
		JLabel lblHitDice = new JLabel("Hit Dice");
		lblHitDice.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 12));
		lblHitDice.setHorizontalAlignment(SwingConstants.CENTER);
		lblHitDice.setBounds(10, 11, 120, 14);
		panel_2.add(lblHitDice);
		
		JTextArea hitDiceValue = new JTextArea();
		hitDiceValue.setBorder(UIManager.getBorder("TextField.border"));
		hitDiceValue.setBackground(Color.WHITE);
		hitDiceValue.setBounds(10, 25, 120, 50);
		panel_2.add(hitDiceValue);
		
		JLabel lblTotal = new JLabel("Total:");
		lblTotal.setBounds(10, 86, 35, 14);
		panel_2.add(lblTotal);
		
		totalHitDiceValue = new JTextField();
		totalHitDiceValue.setBounds(55, 83, 75, 20);
		panel_2.add(totalHitDiceValue);
		totalHitDiceValue.setColumns(10);
		
		JPanel panel_3 = new JPanel();
		panel_3.setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
		panel_3.setBounds(160, 310, 155, 89);
		add(panel_3);
		panel_3.setLayout(null);
		
		JLabel lblDeathSaves = new JLabel("Death Saves");
		lblDeathSaves.setHorizontalAlignment(SwingConstants.CENTER);
		lblDeathSaves.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 12));
		lblDeathSaves.setBounds(10, 11, 135, 14);
		panel_3.add(lblDeathSaves);
		
		JCheckBox successSaveCB3 = new JCheckBox("");
		successSaveCB3.setBounds(124, 32, 21, 23);
		panel_3.add(successSaveCB3);
		
		JCheckBox successSaveCB2 = new JCheckBox("");
		successSaveCB2.setBounds(101, 32, 21, 23);
		panel_3.add(successSaveCB2);
		
		JCheckBox successSaveCB1 = new JCheckBox("");
		successSaveCB1.setBounds(78, 32, 21, 23);
		panel_3.add(successSaveCB1);
		
		JLabel lblSuccesses = new JLabel("Successes");
		lblSuccesses.setBounds(10, 36, 62, 14);
		panel_3.add(lblSuccesses);
		
		JCheckBox failSaveCB3 = new JCheckBox("");
		failSaveCB3.setBounds(124, 58, 21, 23);
		panel_3.add(failSaveCB3);
		
		JCheckBox failSaveCB2 = new JCheckBox("");
		failSaveCB2.setBounds(101, 58, 21, 23);
		panel_3.add(failSaveCB2);
		
		JCheckBox failSaveCB1 = new JCheckBox("");
		failSaveCB1.setBounds(78, 58, 21, 23);
		panel_3.add(failSaveCB1);
		
		JLabel lblFailures = new JLabel("Failures");
		lblFailures.setBounds(10, 61, 62, 14);
		panel_3.add(lblFailures);
	}
}
